<meta http-equiv="content-type" content="text/html; charset=utf-8">
<?php
require_once 'config/config.php';
$connection = mysql_connect(DB_HOST . ":" . DB_PORT, DB_USER, DB_PASS) or die(mysql_error());
mysql_select_db(DB_NAME, $connection);

function  getPages ($query){
    global $connection;
    $pages  =array();
    $data = mysql_query($query, $connection);
    while ($row = mysql_fetch_assoc($data)) {
        $pages[] = $row;
    }
    return $pages;
}
function  getCompanys ($query){
    global $connection;
    $companies  =array();
    $data = mysql_query($query, $connection);
    while ($row = mysql_fetch_assoc($data)) {
        $companies[] = $row;
    }
    return $companies;
}
function  getApps ($query){
    global $connection;
    $Apps  =array();
    $data = mysql_query($query, $connection);
    while ($row = mysql_fetch_assoc($data)) {
        $Apps[] = $row;
    }
    return $Apps;
}
   
function query($query) {
     global $connection;
    $resutls  =array();
    $data = mysql_query($query, $connection);
    while ($row = mysql_fetch_assoc($data)) {
        $resutls[] = $row;
    }
    return $resutls;
    
}